<?php
/*
 *author:Yangligao
 *Date:2013-10-1
 *这个页面时商品详情，点击进入时还需要对商品的的热度+1
 */
require 'Config.php';
require 'Public/Include/adv.php';
require 'Public/Include/footer.php';
require 'Public/Include/search.php';
require 'Public/Include/HotSort.php';
require 'Public/Include/latest.php';
$smarty->assign('positionFlag',"商品详情");
//接收商品id
$food_id = $_GET['food_id'];
//查询商品详细信息
$foodModel = new FoodModel();


//分配数据
$eachFoodRes = $foodModel->food_select("*","where food_id={$food_id}");
$eachFoodRes[0]['food_indate'] = ($eachFoodRes[0]['food_enddate']-$eachFoodRes[0]['food_producttime'])/(3600*24);
$smarty->assign('eachFoodRes',$eachFoodRes[0]);
//更新点击次数
$foodModel->food_update(array('food_count'=>$eachFoodRes[0]['food_count']+1,'food_id'=>$food_id));

$smarty->display('Index/fooddetail.html');

?>
